home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
arachne.igz
/
arachne.img
/
BIN
/
MODBOOT.CAB
/
bin
/
unpack.bat
< prev
Wrap
DOS Batch File
|
2005-01-16
|
2KB
|
74 lines
@if "%debug%"=="" echo off
if not exist %1 goto _trycab
set unpack_f=%1
goto _unpack
:_trycab
if not exist %1.%arcext% goto _nofile
set unpack_f=%1.%arcext%
:_unpack
echo UNPACK: Extracting "%unpack_f%"
if exist %ramdrv%\autorun.bat del %ramdrv%\autorun.bat
:_noexec1
if not exist %ramdrv%\%3nul goto _unpackerr
if "%arcext%"=="cab" goto _extcab
if "%arcext%"=="zip" goto _unzip
if "%arcext%"=="lzh" goto _lha
goto _unpackerr
:_lha
if "%xtrct%"=="verbose" goto _ver2bose
goto _si2lent
:_ver2bose
%ramdrv%\bin\lha.exe x -m1 %unpack_f% %ramdrv%\%3 %4 %5 %6 %7 %8
goto _xtrcted
:_si2lent
%ramdrv%\bin\lha.exe x -m1 -n2 %unpack_f% %ramdrv%\%3 %4 %5 %6 %7 %8
goto _xtrcted
:_unzip
if "%xtrct%"=="verbose" goto _ver3bose
goto _si3lent
:_ver3bose
%ramdrv%\bin\unzip.exe -o %unpack_f% -d %ramdrv%\%3 %4 %5 %6 %7 %8
goto _xtrcted
:_si3lent
%ramdrv%\bin\unzip.exe -o -qq %unpack_f% -d %ramdrv%\%3 %4 %5 %6 %7 %8
goto _xtrcted
:_extcab
if "%xtrct%"=="verbose" goto _verbose
goto _silent
:_verbose
%ramdrv%\bin\extract.exe /y /l %ramdrv%\%3 /e %unpack_f% %4 %5 %6 %7 %8
goto _xtrcted
:_silent
%ramdrv%\bin\extract.exe /y /l %ramdrv%\%3 /e %unpack_f% %4 %5 %6 %7 %8 >%tmp%\extract.out
:_xtrcted
if errorlevel 1 goto _unpackerr
set unpackerr=
if not exist %ramdrv%\autorun.bat goto _end
if not "%2"=="-x" if not '%2'=='-X' goto _noexec
shift
for %%i in (9 8 7 6 5 4 3 2 1 0) do if not exist %ramdrv%\_autoru%%i.bat set unpack_a=_autoru%%i.bat
type %ramdrv%\autorun.bat >%ramdrv%\%unpack_a%
del %ramdrv%\autorun.bat
call %ramdrv%\%unpack_a% %2 %3 %4 %5 %6 %7 %8 %9
if not "%unpackerr%"=="" goto _end
for %%i in (0 1 2 3 4 5 6 7 8 9) do if exist %ramdrv%\_autoru%%i.bat set unpack_a=_autoru%%i.bat
del %ramdrv%\%unpack_a%
set unpack_a=
:_noexec
if exist %ramdrv%\autorun.bat del %ramdrv%\autorun.bat
goto _end
:_nofile
echo.
echo UNPACK: Cannot find file "%1" or "%1.%arcext%"
@rem pause
goto _end
:_unpackerr
if exist %tmp%\extract.out type %tmp%\extract.out
echo.
echo UNPACK: Error while unpacking "%1"
set unpackerr=1
goto _end
:_end
if exist %tmp%\extract.out del %tmp%\extract.out
set unpack_f=